import  java.util.Scanner;
public class Main{
    public static  void main(String[] args){
        System.out.println("ax^2+bx+c=0");
        System.out.println("请输入a,b,c的值：");
        Scanner scanner = new Scanner(System.in);
        double a=scanner.nextDouble();
        double b=scanner.nextDouble();
        double c=scanner.nextDouble();
        Fun fun = new Fun(a,b,c);
        if(fun.delta()>=0)
            System.out.println(fun.solution());
        else{
            System.out.println("方程无解");
        }
    }
}
class Fun{
    private double a;
    private double b;
    private double c;
    public Fun(double a,double b,double c)
    {
        this.a=a;
        this.b=b;
        this.c=c;
    }
    public double delta(){
        return (Math.pow(b,2)-4*a*c);
    }
    public String solution(){
        return "x1="+((-b+Math.sqrt(delta()))/(2*a))+"  x2="+((-b-Math.sqrt(delta()))/(2*a));
    }
}